package Lamada;

import Lamada.Student;

import java.util.Arrays;
import java.util.Comparator;

public class Test3 {
    public static void main(String[] args) {
        Lamada.Student[] s=new Student[5];
        s[0]=new Lamada.Student("Alice", 18, 1.7);
        s[1]=new Lamada.Student("Bob", 17, 1.6);
        s[2]=new Lamada.Student("Charlie", 16, 1.5);
        s[3]=new Lamada.Student("David", 19, 1.8);
        s[4]=new Lamada.Student("Eve", 18, 1.7);

//        Arrays.sort(s, Student::compareByAge);
        Student t=new Student();
        Arrays.sort(s, t:: compareByHeight);
        // 打印排序结果

        System.out.println("排序后的学生列表：");
        for (Student student : s) {
            System.out.println(student);
        }
    }
}
